<h1><%=t ".title"%></h1>

<p>
  <%= t('activerecord.attributes.author.last_name') %>
  <%= text_field_tag('search_last_name', @filter_last_name, :size => 30 ) %>
</p>

<p>
  <%= t('activerecord.attributes.author.first_name') %>
  <%= text_field_tag('search_first_name', @filter_first_name, :size => 30 ) %>
</p>

<p>
  <%= t('activerecord.attributes.author.country') %>
  <%= collection_select(:country, :id, @countries, :id, :name, :include_blank => "Todas") %>
  <%= image_tag("load.gif",
      :align => "absmiddle",
      :border => 0,
      :id => "spinner",
      :style =>"display: none;" ) %>
</p>


<p/>
<%= observe_field 'search_last_name',
    :frequency => 1,
    :update => 'list_table',
    :before => "Element.show('spinner')",
    :success => "Element.hide('spinner')",
    :url => {:action => 'list'},
    :with => "'search_first_name='+ document.getElementById('search_first_name').value + '&' + 'search_last_name='+ document.getElementById('search_last_name').value"%>

<%= observe_field 'search_first_name',
    :frequency => 1,
    :update => 'list_table',
    :before => "Element.show('spinner')",
    :success => "Element.hide('spinner')",
    :url => {:action => 'list'},
    :with => "'search_first_name='+ document.getElementById('search_first_name').value + '&' + 'search_last_name='+ document.getElementById('search_last_name').value"%>

<%= observe_field 'country_id',
    :frequency => 1,
    :update => 'list_table',
    :before => "Element.show('spinner')",
    :success => "Element.hide('spinner')",
    :url => {:action => 'list'},
    :with => "'search_country=' +value + '&' + 'search_first_name='+ document.getElementById('search_first_name').value + '&' + 'search_last_name='+ document.getElementById('search_last_name').value"%>

<div id="list_table">
  <%= render :partial => "authors_list" %>
</div>
